home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 22
/
Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso
/
Aminet
/
dev
/
e
/
Chris_emods.lha
/
testprogresswin.e
< prev
Wrap
Text File
|
1997-09-05
|
2KB
|
96 lines
/* This example doesn't work and I don't know why.
It crashes after locking the screen. But it works
when I use it in EvenMore. Oh well. */
/* (Not so strange really, you forgot to open the libs :-) */
OPT OSVERSION=37,
REG=5
MODULE '*progresswin',
'gadtools',
'diskfont'
/* SV: again autorasing exceptions
*/
RAISE "LIB" IF OpenLibrary()=NIL
PROC main() HANDLE
DEF count,
pw=NIL:PTR TO progresswin /* SV: allocate it dynamical otherwise the
** memory is uninitialized!!!
*/
diskfontbase:=OpenLibrary('diskfont.library',37)
gadtoolsbase:=OpenLibrary('gadtools.library',37)
NEW pw
openprogresswin(pw,NIL,NIL,'(pling) Elevator ready...')
Delay(75)
drawprogresstext(pw,'Going up...')
Delay(25)
FOR count:=0 TO 49
drawprogressgad(pw,count)
Delay(1)
ENDFOR
drawprogresstext(pw,'Stand by...')
Delay(75)
drawprogresstext(pw,'50 to go...')
FOR count:=50 TO 100
drawprogressgad(pw,count)
Delay(1)
ENDFOR
drawprogresstext(pw,'(snap) Oops! No wire...')
Delay(75)
drawprogresstext(pw,'Gooing doooown...')
FOR count:=100 TO 50 STEP -1
drawprogressgad(pw,count)
Delay(1)
ENDFOR
drawprogresstext(pw,'(Hick)...')
Delay(60)
drawprogresstext(pw,'50 to go...')
FOR count:=49 TO 0 STEP -1
drawprogressgad(pw,count)
Delay(1)
ENDFOR
drawprogresstext(pw,'You can go home now...')
Delay(150)
EXCEPT DO
/* SV: Cleaning up
*/
IF pw
closeprogresswin(pw)
END pw
ENDIF
/* SV: Since v36 we can pass NIL-pointers here
*/
CloseLibrary(diskfontbase)
CloseLibrary(gadtoolsbase)
ENDPROC